<template>
  <div>
    <h3>id：{{current.id}}</h3>
    <h3>title: {{current.title}}</h3>
  </div>
</template>

<script>
export default {
  name: 'DetailView',
  computed: {
    id() {
      return this.$route.query.id
    },
    current() {
      return this.$store.state.message.current;
    }
  },
  watch: {
    id() {
      this.$store.dispatch('message/getCurrent', this.id)
    }
  },
  mounted() {
    // console.log(this.$route.query && this.$route.query.id, this.id)
    this.$store.dispatch('message/getCurrent', this.id)
  },
}
</script>

<style>

</style>